package com.village.friend.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.village.friend.dto.request.ActivityListDto;
import com.village.friend.dto.response.ActivityListResDto;
import com.village.friend.entity.Activity;
import com.village.friend.mapper.ActivityMapper;
import com.village.friend.mapper.UserLikeMapper;
import com.village.friend.service.ActivityService;
import com.village.friend.utils.ParamUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author yl
 * @since 2021-08-13
 */
@Service
public class ActivityServiceImpl extends ServiceImpl<ActivityMapper, Activity> implements ActivityService {

    @Override
    public List<Activity> list(Integer createUserId, Integer joinUserId, Integer reqUserId, Integer type, Integer gender, String city, Double latitude, Double longitude, Integer limit, Integer offset) {
        return baseMapper.list(createUserId, joinUserId, reqUserId, type, gender, city, latitude, longitude, limit, offset);
    }

    @Override
    public Integer listCount(Integer createUserId, Integer joinUserId, Integer reqUserId, Integer type, Integer gender, String city) {
        return baseMapper.listCount(createUserId, joinUserId, reqUserId, type, gender, city);
    }

    @Override
    public Boolean updateStatus(Integer id, Integer status) {
        Activity activity = new Activity();
        activity.setId(id);
        activity.setStatus(status);
        return updateById(activity);
    }

    @Override
    public Integer getActivityCountToMonth(Integer userId) {
        return baseMapper.getActivityCountToMonth(userId);
    }

}
